1

<?php echo link_to('xxx','testjquery/test',array('id'=>'xxx',)) ?>

<script language="javascript">
    $("#xxx").click(function(e){
      alert('xxx');
      e.preventDefault();
    });
</script>